<?php
/**
 * Test Handler file
 *
 * @author Richard Thomas <lists@cyberlot.net>
 * @version 0.1
 * @package pjq
 * @subpackage test
 * @copyright Copyright &copy; 2007, Richard Thomas
 */

  require_once('Pjq.php');

function getarray() {
  return array('a' => 1, 'b' => 2);
}

function simplehtml($params) {
  return '<B>Injected HTML'.$params.'</B>';
}

function jqueryeffects() {
  require_once('Pjq_Response.php');
  $responseObject = Pjq_Response::getInstance();
  $attribs = array();
  $attribs['class'] = 'large';
  $responseObject->attr($attribs);
  $responseObject->show();
  $responseObject->addClass('green');
  $responseObject->Script('alert("Hello")');
}

  if((isset($_POST) AND sizeof($_POST)) OR (isset($_GET) AND sizeof($_GET))) {
    $handler = new Pjq();
    $handler->registerCallback('getarray');
    $handler->registerCallback('simplehtml');
    $handler->registerCallback('jqueryeffects');
    $handler->processIncoming();
    exit();
  }
?>